	 SUBROUTINE SHORELN(IMAX,JSHORE,YOFF,H,Hmax,Hmin,DELTAY,YSHORE)
c
c    This routine checks each "surf zone/beach" cell to determined
c    if it has been underfilled or overfilled when the depth grid 
c    was adjusted in the EXNER subroutine.  When overfilling is 
c    detected the cell is made a LAND cell and the surf zone/beach
c    cell is advanced one unit into the ocean.  Underfilling results
c    in the converse action.
c
c    This routine also determines the amount of offset between the 
c    shoreline and the center of the surf zone/beach cell (YOFF). This
c    is used to compute a new XSHORE AND YSHORE coordinate so that a 
c    a smooothly curved shoreline results and its location shows the
c    instantaneous location of the shoreline in sub-grid intervals. 
c
c    The offset Yref is used to relate the position of the shoreline
c    relative to the cell center for the case where Hmax .NE. -Hmin.
c    In this case, when the cell is in its neutral or half-filled
c    condition the shoreline does not coincide with the cell center
c    and Yref represents this difference. This means that there will
c    be cases as the JSHORE(I) cell is just filling (or emptying)
c    where the shoreline (YSHORE(I)) will lie just outside the
c    JSHORE(I) cell - - but never more than Yref.
c
c
    	DIMENSION JSHORE(150),YOFF(150),H(150,150),YSHORE(150)
c
	DO 100 I=1,IMAX
	J=JSHORE(I)
	DH = -(Hmax - Hmin)
	Yref= -((Hmin/DH)-(1/2))*DELTAY
	YOFFpr= -(H(I,J)/DH)*DELTAY
c
	IF(ABS(YOFFpr).LE.(DELTAY/2.))GOTO 100
	IF(YOFFpr.GE.0.0)GOTO 80
	Hdiff = H(I,J)-Hmin
	H(I,J-1) = H(I,J-1)-Hdiff
	H(I,J)=Hmin
	JSHORE(I) = JSHORE(I)-1
	YOFFpr=YOFFpr + (DELTAY*(1.0-(Hdiff/DH)))
	GOTO 90
   80	JSHORE(I) = JSHORE(I)+1
	Hdiff = Hmax-H(I,J)
	H(I,J)=H(I,J)+Hdiff
	YOFFpr=YOFFpr -(DELTAY*(1.0+(Hdiff/DH)))
   90	YOFF(I) = Yref + YOFFpr
	YSHORE(I)=((float(JSHORE(I))-0.5)*DELTAY)+YOFF(I)
c
  100	 CONTINUE
c
	RETURN
	END